package com.mall.users.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.mall.model.domain.UmsAdminRoleRelation;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
* @author LQJdeDELL
* @description 针对表【ums_admin_role_relation(后台用户和角色关系表)】的数据库操作Mapper
* @createDate 2023-03-09 22:29:17
* @Entity generator.domain.UmsAdminRoleRelation
*/
public interface UmsAdminRoleRelationMapper extends BaseMapper<UmsAdminRoleRelation> {

    @Select("select * from ums_admin_role_relation where admin_id = #{adminId}")
    List<UmsAdminRoleRelation> selectByAdminId(Long adminId);

    @Delete("delete from ums_admin_role_relation where admin_id = #{adminId}")
    void deleteByAdminId(Long adminId);

    void save(@Param("relationList") List<UmsAdminRoleRelation> relationList);

    void deleteByRoleIds(@Param("roleIds") List<Long> roleIds);
}




